package com.tianxiao.faas.common.util;

public class PageUtils {

    public static Integer getOffset(Integer paeNo, Integer pageSize) {
        int offset = (paeNo - 1) * pageSize;
        return offset;
    }

    public static Integer totalPage(Integer count, Integer pageSize) {
        count = count == null ? 0 : count;
        if (count <= pageSize) {
            return 1;
        }
        return (count + pageSize -1) / pageSize;
    }
}
